﻿@{
    ViewBag.Title = "Главная";
}

<div id="index_rightCol">
    <h1>Мы сделали <a href="@Url.Action("IndexFinished", "Project")">@ViewBag.CompletedProjectsCount @(ViewBag.WordFormatter.GetNumericalWordForm((string)"проект", (int)ViewBag.CompletedProjectsCount))</a></h1>
	@if (ViewBag.RecentCompletedProjects.Count == 0)
 {
		<div>Нет проведённых проектов</div>
 }
 else
 {
		<ul id="сompletedProjects_list" class="projectsList">
		@foreach (Project p in ViewBag.RecentCompletedProjects)
  {
			<li class="projectsList_item">
				@ProjectAvatar.Small(p, imageClass: "projectList_item_image")
				<h2 class="projectList_item_title">
					@Date.Nice(p.Ending, "projectList_item_date", "Дата не выбрана")
					@(Html.ActionLink<ProjectController>(x => x.View(p.Id), p.Name))
				</h2>
                @if (p.IsHidden)
                {
                    <span class="warning">Проект скрыт</span>
                }
                @{
                    int participantsCount = p.Participants.Count();
				<p>Мы сделали это! @ViewBag.WordFormatter.GetNumericalWordForm("Был", participantsCount) @participantsCount @ViewBag.WordFormatter.GetNumericalWordForm("человек", participantsCount)</p>
                }
				@*<a href="#" class="projectList_item_photoLink">Фотоотчет</a>*@
			</li>
  }
		</ul>
		if (ViewBag.MoreCompletedProjectsCount != 0)
		{
			<a href="@Url.Action("IndexFinished", "Project")" id="сompletedProjects_readmoreLink">Еще @ViewBag.MoreCompletedProjectsCount @ViewBag.WordFormatter.GetNumericalWordForm((string)"законченный", ViewBag.MoreCompletedProjectsCount) @ViewBag.WordFormatter.GetNumericalWordForm((string)"проект", ViewBag.MoreCompletedProjectsCount)</a>
		}
 }
</div>

<div id="index_leftCol_outer">
	<div id="index_leftCol">
    <h1>Ближайшие проекты</h1>
	@if (ViewBag.FewUpcomingProjects.Count == 0)
 {
		<div>Нет запланированных проектов</div>
 }
 else
 {
		<ul id="upcomingProjects_list" class="projectsList">
		@foreach (Project p in ViewBag.FewUpcomingProjects)
  {
			<li class="projectsList_item">
			<br/>
				@ProjectAvatar.Large(p, imageClass: "projectList_item_image")
				<h2 class="projectList_item_title">
					@Date.Nice(p.Beginning, "projectList_item_date", "Дата не выбрана")
   					@(Html.ActionLink<ProjectController>(x => x.View(p.Id), p.Name))
				</h2>
                @if (p.IsHidden)
                {
                    <span class="warning">Проект скрыт</span>
                }
					@Data.VacanciesString(ViewBag.Inflector, p)
				<div class="projectList_item_peopleCounter">Уже @p.Participants.Count() @ViewBag.WordFormatter.GetNumericalWordForm((string)"участник", (int)p.Participants.Count())</div>
				<div class="projectList_item_personContainer person">
					@Html.Partial("UserShowBrief", p.Organizer)
				</div>
			</li>
  }
		</ul>
     if(ViewBag.MoreUpcomingProjectsCount != 0)
     {
		<a href="@Url.Action("IndexUpcoming", "Project")">Предстоит ещё @ViewBag.MoreUpcomingProjectsCount @ViewBag.WordFormatter.GetNumericalWordForm((string)"проект", ViewBag.MoreUpcomingProjectsCount)</a>
     }
	 <br/>
 }
 @if (ViewBag.CurrentUser != null)
 {
	<a href="#" class="showLightBox_link" rel="createIdeaBox">Предложите свой!</a>
 }
 else
 {
    <a href="#" class="showLightBox_link" rel="registerOrLogInBox">Предложите свой!</a>
 }
</div>
</div>
@Html.Action("Main", "News")

<div id="lightbox_shadow">&nbsp;</div>
@Html.Partial("CreateIdeaView", null, new ViewDataDictionary())